package com.dianrui.qiyouriding.adapter;

import android.content.Context;
import android.graphics.Color;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.dianrui.qiyouriding.R;
import com.dianrui.qiyouriding.bean.Feed;

import java.util.List;

public class TroubleFeedAdapter extends BaseQuickAdapter<Feed, BaseViewHolder> {

    public TroubleFeedAdapter(Context mContext) {
        super(R.layout.troublefeed_item);
        this.mContext = mContext;
    }
    public TroubleFeedAdapter(Context mContext, List<Feed> list) {
        super(R.layout.troublefeed_item,list);
        this.mContext = mContext;
    }



    @Override
    protected void convert(BaseViewHolder helper, Feed item) {
        helper.setText(R.id.feed_name,item.getName());
        if (item.isChecked) {
            helper.setBackgroundRes(R.id.choose_layout, R.color.main_color);
            helper.setTextColor(R.id.feed_name, Color.WHITE);
        }else {
            helper.setBackgroundRes(R.id.choose_layout, R.color.white);
            helper.setTextColor(R.id.feed_name, Color.BLACK);
        }

    }
}
